[TT-14991] Fixed decode settings to fallback to global settings#901
[TT-14991] Fixed decode settings to fallback to global settings#901
Conversation
🔍 Code Analysis ResultsPull Request Analysis: TT-14991 Fixed decode settings to fallback to global settingsThis pull request addresses a bug in how decoding settings for raw requests and responses are handled, ensuring that pump-specific settings correctly fall back to global configurations. 1. Change Impact AnalysisWhat this PR accomplishesThe primary goal of this PR is to fix the configuration inheritance logic for Key Technical ChangesThe changes are concentrated in
Affected System Components
2. Architecture VisualizationThe following flowchart visualizes the updated logic within the flowchart TD
subgraph "filterData Function"
A[Analytics Record Received] --> B{Get Decoding Settings};
B --> C{Should Trim Data?};
C -- Yes --> D[trimRawData];
C -- No --> E;
D --> E{Apply Filters};
E --> F{Remove Ignored Fields};
F --> G{Perform Base64 Decoding?};
G -- Yes --> H[decodeBase64Data];
G -- No --> I[Send to Pump];
H --> I;
end
subgraph "getDecodingSettings Logic"
B1[Start] --> B2{Pump raw_request_decoded is true?};
B2 -- Yes --> B3[Use true for Request Decoding];
B2 -- No --> B4{Global DecodeRawRequest is true?};
B4 -- Yes --> B3;
B4 -- No --> B5[Use false for Request Decoding];
B6[Start] --> B7{Pump raw_response_decoded is true?};
B7 -- Yes --> B8[Use true for Response Decoding];
B7 -- No --> B9{Global DecodeRawResponse is true?};
B9 -- Yes --> B8;
B9 -- No --> B10[Use false for Response Decoding];
end
style getDecodingSettings Logic fill:#f9f,stroke:#333,stroke-width:2px
This diagram illustrates how an analytics record is processed. The key change is in the "Get Decoding Settings" step, which now correctly combines pump and global settings to decide whether the Powered by Visor from Probelabs Last updated: 2025-10-09T08:23:37.979Z | Triggered by: opened | Commit: 4cf6f09 |
🔍 Code Analysis ResultsSecurity Issues (1)
Performance Issues (3)
✅ Quality Check PassedNo quality issues found – changes LGTM. ✅ Style Check PassedNo style issues found – changes LGTM. Powered by Visor from Probelabs Last updated: 2025-10-09T08:23:38.797Z | Triggered by: opened | Commit: 4cf6f09 |
Addresses https://tyktech.atlassian.net/browse/TT-14991
Description
This fix will make it so that if a
decodesetting (raw_request_decodedorraw_response_decoded) isfalseor not defined at the pump level, then it will fallback to the global settings.Related Issue
Motivation and Context
Customers had to enable decoding settings for each and every pump they wanted this behaviour in.
How This Has Been Tested
Example of config
Trigger variaous requests to the API, and observe the files created under /reports folder and you can check the results.
Screenshots (if appropriate)
Types of changes
Checklist
fork, don't request your
master!masterbranch (left side). Also, you should startyour branch off our latest
master.go mod tidy && go mod vendorgo fmt -sgo vet